const fs = require("fs");
const package = require("./package.json");
const ormconfig = require("./ormconfig.json");
ormconfig.entities = ["entitys/**/*.js"];
const ws1 = fs.createWriteStream("./dist/ormconfig.json");
ws1.write(JSON.stringify(ormconfig, "", "\t"));
ws1.end();
ws1.close();
const ws = fs.createWriteStream("./dist/package.json");
delete package.devDependencies;
delete package.scripts.build;
delete package.scripts["build:watch"];
delete package.scripts["start:watch"];
delete package.scripts.start;
delete package.scripts.debug;
package.scripts.start =
  "NODE_ENV=production && pm2 start app.js --name node-admin";
ws.write(JSON.stringify(package, "", "\t"));
ws.end();
ws.close();
